import 'package:flutter/material.dart';

class listViewPage extends StatelessWidget {
  const listViewPage({super.key});

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        backgroundColor: Theme.of(context).colorScheme.inversePrimary,
        title: const Text('Text'),
      ),
      body: Padding(
        padding: const EdgeInsets.all(20.0),
        child: buildListView2(),
      ),
    );
  }

  ListView buildListView1() {
    return ListView(

        children: const [
          Text("A"),
          Text("B",style: TextStyle(fontSize: 30,color: Colors.deepPurple),),
          Text("C",style: TextStyle(fontWeight: FontWeight.w600,decoration: TextDecoration.underline),),
          Text("D",style: TextStyle(fontWeight: FontWeight.w600,decoration: TextDecoration.lineThrough),),
        ],
      );
  }

  ListView buildListView2(){
    return ListView.builder(itemBuilder: (context,index){
      return Container(
        margin: EdgeInsets.only(top: 10),
        alignment: Alignment.center,
        decoration: BoxDecoration(
          color: Colors.deepPurple,
          borderRadius: BorderRadius.circular(8)
        ),
        width: 100,height: 100,child: Text("第${index}个item",style: TextStyle(fontSize: 20,color: Colors.white),),);
    },itemCount: 100,);
  }
}
